#pragma once
#include "dxut.h"
#include "dxutgui.h"
#include "mytypes.h"

namespace poly
{
	class IGraphic
	{
	public:
		virtual void render( float44 const & ) = 0;
	};




	class IInput
	{
	public:
		virtual ~IInput(){}
		struct MOUSESTATE {
			int32 x;
			int32 y;
			int32 z;
			uint8 buttons[4];
		};

		struct JOYSTATE {
			int32 x;
			int32 y;
			int32 z;
			int32 rx;
			int32 ry;
			int32 rz;
			int32 slider[2];
			uint32 POV[4];
			uint8 buttons[32];
		};

		struct KEYSTATE {
			uint8 keys[256];
		};

		virtual MOUSESTATE mouseState() = 0;
		virtual KEYSTATE keyState( ) = 0;
		virtual JOYSTATE joyState( uint32 joyIndex ) = 0;
	};




	class IGame
	{
	public:
		virtual ~IGame(){}

		virtual void onCreateGraphics( D3DDevice device){};
		virtual void onResetGraphics( D3DDevice device){};

		virtual void onFrameMove(float dt){};
		virtual void onFrameRender(float dt){};

		virtual void onLostGraphics(){};
		virtual void onDestroyGraphics(){};

		virtual bool msgProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
		{ return false; }


		//Get window settings from IGame class
		//Parameters: width, height, windowed, minimizebox, maximizebox
		virtual void getWindowSettings(int &, int &, bool &, bool &, bool &){}
		virtual void getBackground( float3 & color ){}
	};

} // end of poly
